home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / circuits / ocean / cacd_bin.000 / cacd_bin / lib / include / dmmem.h < prev    next >
C/C++ Source or Header  |  1994-05-06  |  945b  |  27 lines

  1. /*
  2.  * This file redirects memory allocation calls to a private memory manager. The
  3.  * standard ways of calling malloc and free cost too much. The implementation
  4.  * of dmNew and dmFree is in the file dmmem.c and memman.c, which is a straight
  5.  * copy of the OCEAN/src/libseadif/memman.c memory manager.
  6.  */
  7.  
  8. #define malloc(siz)       dmNew((int)siz)
  9. #define calloc(num,siz)   dmNew((int)(num*siz))
  10.  
  11. /* realloc() is never used in libddm, so that's one worry less */
  12.  
  13. /* All calls to free() in de libddm sources have been replaced by calls to
  14.  * dmFree() already, by grep'ing and hand-hacking the sources.
  15.  */
  16.  
  17. #define free(ptr)         free_does_not_exist_use_dmFree_instead((void *)ptr)
  18.  
  19. #define DM_UNKNOWN_SIZE   (-1)      /* second arg for dmFree */
  20.  
  21. /* generate linker errors if somebody tries to use free(): */
  22. #ifdef __STDC__
  23. void  free_does_not_exist_use_dmFree_instead(char **ptr);
  24. #else
  25. void  free_does_not_exist_use_dmFree_instead();
  26. #endif
  27.